package me.ctidy.assignment02;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

public class SecondActivity extends AppCompatActivity {

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_second);
        Button btn = findViewById(R.id.second_btn_back);
        btn.setOnClickListener((v) -> {
            // 使用 intent 跳转, 该 Activity 仍然保留在内存中
            //Intent intent = new Intent("android.intent.action.MAIN");
            //startActivity(intent);
            finish();
        });
    }

    public void onSecondBtnClick(View v) {
        Toast.makeText(this, R.string.ctidy_sid_name, Toast.LENGTH_LONG).show();
    }

}
